let uid = 0;
export default class Dep {
  constructor() {
    this.subs = [];
    this.id = uid++;
  }
  addsub(target) {
    this.subs.push(target);
  }
  depend() {
    if (Dep.target) {
      this.addsub(Dep.target);
    }
  }
  notify() {
    let subs = this.subs.slice();

    for (var i = 0, l = subs.length; i < l; i++) {
      subs[i].update();
    }
  }
}
